//  数据模拟
var data = {
    nowDate: { // 服务器时间
        "today_response": {
            "today": "20170911"
        }
    },
    createOrder: { // 创建订单
        "xtsd_OrderInfo_response": {
            "res_timestamp": 20170920150438,
            "res_sign": "8FE61CAD90E29DA53B08B4B25AA77637",
            "serialNo": "031505891077422549",
            "respCode": "0000",
            "respMsg": "订单创建成功"
        }
    },
    orderbyorder: { // 订单详情
        "xtsd_OrderInfo_response": {
            "res_timestamp": 20170920202017,
            "res_sign": "77CBBBDB911926E13857A4FBB04C3789",
            "respCode": "0000",
            "resXtsdOrderInfos_arrays": {
                "resXtsdOrderInfos": [{
                    "idNo": 350125198712230071,
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920193635,
                    "orderState": "01",
                    "borrowAmt": 10000,
                    "expiryDate": "0922",
                    "applyTime": 193635,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505907395922791",
                    "prdtNoString": "0301",
                    "applyTimeString": 193635,
                    "creditCardNo": 12345678901234,
                    "endRepayDate": 20171015,
                    "cvn2": 123,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920193635,
                    "custName": "陈先生",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505907395922457233"
                }]
            },
            "respMsg": "查询成功"
        }
    },
    loanRecord: { // 闪贷交易记录
        "xtsd_OrderInfo_response": {
            "res_timestamp": 20170920193754,
            "res_sign": "EA5DB9DE37CAA389B53EC765AC0408D5",
            "respCode": "0000",
            "resXtsdOrderInfos_arrays": {
                "resXtsdOrderInfos": [{
                    "idNo": 350125198712230071,
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920193635,
                    "orderState": "01",
                    "borrowAmt": 10000,
                    "expiryDate": "0922",
                    "applyTime": 193635,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505907395922791",
                    "prdtNoString": "0301",
                    "applyTimeString": 193635,
                    "creditCardNo": 12345678901234,
                    "endRepayDate": 20171015,
                    "cvn2": 123,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920193635,
                    "custName": "陈先生",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505907395922457233"
                }, {
                    "idNo": 350125198612230071,
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920191300,
                    "orderState": "02",
                    "borrowAmt": 9000,
                    "expiryDate": "0823",
                    "applyTime": 191300,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505905980073702",
                    "prdtNoString": "0301",
                    "applyTimeString": 191300,
                    "creditCardNo": 12345678901234,
                    "endRepayDate": 20171015,
                    "cvn2": 123,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920191300,
                    "custName": "陈至立",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505905980073368589"
                }, {
                    "idNo": "35012519871223007X",
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920151845,
                    "orderState": "00",
                    "borrowAmt": 8000,
                    "expiryDate": "0922",
                    "applyTime": 151845,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505891925473634",
                    "prdtNoString": "0301",
                    "applyTimeString": 151845,
                    "creditCardNo": 12345678903456,
                    "endRepayDate": 20171015,
                    "cvn2": 234,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920151845,
                    "custName": "陈好",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505891925473922753"
                }, {
                    "idNo": "35012519871223007X",
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920151732,
                    "orderState": "01",
                    "borrowAmt": 10000,
                    "expiryDate": "0922",
                    "applyTime": 151732,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505891852121012",
                    "prdtNoString": "0301",
                    "applyTimeString": 151732,
                    "creditCardNo": 1234567890123456,
                    "endRepayDate": 20171015,
                    "cvn2": 234,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920151732,
                    "custName": "陈好",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505891852121678366"
                }, {
                    "idNo": "35012519851223007X",
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920150437,
                    "orderState": "00",
                    "borrowAmt": 9000,
                    "expiryDate": "0922",
                    "applyTime": 150437,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505891077422549",
                    "prdtNoString": "0301",
                    "applyTimeString": 150437,
                    "creditCardNo": 12345678902345,
                    "endRepayDate": 20171015,
                    "cvn2": 234,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920150437,
                    "custName": "陈好",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505891077422878590"
                }, {
                    "idNo": "35012519851223007X",
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920144807,
                    "orderState": "02",
                    "borrowAmt": 7000,
                    "expiryDate": "0922",
                    "applyTime": 144807,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505890087514037",
                    "prdtNoString": "0301",
                    "applyTimeString": 144807,
                    "creditCardNo": 12345678902345,
                    "endRepayDate": 20171015,
                    "cvn2": 234,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920144807,
                    "custName": "陈好",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505890087514400191"
                }, {
                    "idNo": "35012519871223007X",
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920101857,
                    "orderState": "01",
                    "borrowAmt": 10000,
                    "expiryDate": "0922",
                    "applyTime": 101857,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505873937634407",
                    "prdtNoString": "0301",
                    "applyTimeString": 101857,
                    "creditCardNo": 123456789012345,
                    "endRepayDate": 20171015,
                    "cvn2": 123,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920101857,
                    "custName": "陈好",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505873937634894827"
                }, {
                    "idNo": "35012519871223007X",
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920151732,
                    "orderState": "01",
                    "borrowAmt": 10000,
                    "expiryDate": "0922",
                    "applyTime": 151732,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505891852121012",
                    "prdtNoString": "0301",
                    "applyTimeString": 151732,
                    "creditCardNo": 1234567890123456,
                    "endRepayDate": 20171015,
                    "cvn2": 234,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920151732,
                    "custName": "陈好",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505891852121678366"
                }, {
                    "idNo": "35012519851223007X",
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920150437,
                    "orderState": "00",
                    "borrowAmt": 9000,
                    "expiryDate": "0922",
                    "applyTime": 150437,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505891077422549",
                    "prdtNoString": "0301",
                    "applyTimeString": 150437,
                    "creditCardNo": 12345678902345,
                    "endRepayDate": 20171015,
                    "cvn2": 234,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920150437,
                    "custName": "陈好",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505891077422878590"
                }, {
                    "idNo": "35012519851223007X",
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920144807,
                    "orderState": "02",
                    "borrowAmt": 7000,
                    "expiryDate": "0922",
                    "applyTime": 144807,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505890087514037",
                    "prdtNoString": "0301",
                    "applyTimeString": 144807,
                    "creditCardNo": 12345678902345,
                    "endRepayDate": 20171015,
                    "cvn2": 234,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920144807,
                    "custName": "陈好",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505890087514400191"
                }, {
                    "idNo": "35012519871223007X",
                    "freezeAmt": 10175,
                    "serialNoTime": 20170920101857,
                    "orderState": "01",
                    "borrowAmt": 10000,
                    "expiryDate": "0922",
                    "applyTime": 101857,
                    "channelNo": "01",
                    "applyDate": 20170920,
                    "serialNo": "031505873937634407",
                    "prdtNoString": "0301",
                    "applyTimeString": 101857,
                    "creditCardNo": 123456789012345,
                    "endRepayDate": 20171015,
                    "cvn2": 123,
                    "hpNo": 18616952720,
                    "serialNoTimeString": 20170920101857,
                    "custName": "陈好",
                    "tlMerId": 999290053990002,
                    "prdtNo": "0301",
                    "orderId": "031505873937634894827"
                }]
            },
            "respMsg": "查询成功"
        }
    },
    limitData: {
        "xtsd_PrdtMulRate_response": {
            "res_timestamp": 20171025104625,
            "res_sign": "C0EB844337808BFE4ED1EB3D83964B6D",
            "merPrdtMultRates_arrays": {
                "merPrdtMultRates": [{
                    "createTime": "2017-09-27T14:14:25 08:00",
                    "updateTime": "2017-10-19T12:49:24 08:00",
                    "state": 0,
                    "amtUplimit": 50000,
                    "applyRefundDays": 7,
                    "channelNo": "01",
                    "refundType": "01",
                    "amtLowlimit": 600,
                    "id": "7d7ae15350894b59bd25438a4fb1a00f",
                    "updateTimeString": "2017-10-19 12:49:24",
                    "checkRefundDays": 14,
                    "createTimeString": "2017-09-27 14:14:25",
                    "merNo": 999497048140002,
                    "prdtNo": "0301"
                }]
            },
            "respCode": "0000",
            "respMsg": "查询成功"
        }
    },
    rate: { // 利率
        "xtsdprdtrate_response": {
            "res_timestamp": 20170921164126,
            "res_sign": "14C723329B0FACAF81CA16B8A70F2AB9",
            "channelNo": "01",
            "prdtNo": "0301",
            "dayRate": 0.03,
            "prepayCostRate": 22,
            "capitalCostRate": 1,
            "serviceRate": 0.1,
            "withholdCostAmt": 22
        }
    }

};

// 生成订单

// 取现在时间
function getNowDate() {
    return this.data.nowDate;
}

// 根据条件取模拟数据
function getData(reqBoy) {
    console.log(reqBoy.servlet_type);
    if (reqBoy.servlet_type == "create_order") { // 创建订单
        return this.data.createOrder;
    } else if (reqBoy.servlet_type == "query_order") { // 闪贷交易记录列表
        return this.data.loanRecord;
    } else if (reqBoy.servlet_type == "query_today") { // 服务器时间
        return this.data.nowDate;
    } else if (reqBoy.servlet_type == "recreate_order") { // 重新生成订单
        return this.data.createOrder;
    } else if (reqBoy.servlet_type == "query_orderByOrderId") { // 重新生成订单
        return this.data.orderbyorder;
    }

}

function getLimitData(argument) {
    return this.data.limitData;
}

module.exports = {
    "data": data,
    "getNowDate": getNowDate,
    "getData": getData,
    "getLimitData":getLimitData
};
